package com.changgou;

import entity.IdWorker;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.annotation.Bean;
import tk.mybatis.spring.annotation.MapperScan;

import javax.persistence.Id;

/**
 * @author 1
 * @data 2022/1/7
 */
@SpringBootApplication
@EnableEurekaClient//eureka客户端
//扫描指定路径下的所有接口，为借口产生代理对象交给spring容器管理 mapper扫苗
//@MapperScan(basePackages = "com.changgou.goods.dao")

//通用mapper提供的扫描注解
@MapperScan(basePackages = "com.changgou.goods.dao")
public class GoodsApplication {
    public static void main(String[] args) {
        SpringApplication.run(GoodsApplication.class,args);
    }

    //idwork交给spring容器管理如果要使用直接注入就行
    @Bean
    public IdWorker idWorker(){
        return new IdWorker(0,0);
    }
}
